
class Animal(object):
    def __init__(self, name):  # Constructor of the class
        self.name = name
    def talk(self):  # Abstract method, defined by convention only
        raise NotImplementedError("Subclass must implement abstract method")
    def eat(self):
        print("{name} 在吃东西".format(name=self.name))
class Cat(Animal):
    def talk(self):
        print('%s: 喵喵喵!' % self.name)
    def eat(self):
        # 方法中使用super调用父类方法
        super(Cat, self).eat()
        print("子类  {name} 在吃东西".format(name=self.name))

cat = Cat("姚振")
cat.eat()
super(cat.__class__, cat).eat()  # 直接使用super调用父类方法,需要传子类class和实例
